package com.imti.retrofitdemo;

import okhttp3.FormBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

public interface WeatherRequest
{

    @GET("simpleWeather/cityList")
    Call<BaseListRequest<CityItem>> requestCityList(@Query("key") String key);

    @POST("simpleWeather/cityList")
    Call<BaseListRequest<CityItem>> requestCityListPost(@Body FormBody body);

    //使用RxJava监听网络请求
    @GET("simpleWeather/cityList")
    Observable<BaseListRequest<CityItem>> requestCityListByRx(@Query("key") String key);

    @GET("simpleWeather/query?key=8149094547f3e900f1ea47e6a25de938")
    Observable<BaseObjRequest<WeatherResponse>> requestCityWeather(@Query("city") String city);
}
